﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Translater.aspx.cs" Inherits="MyProject.Tools.Translater" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">
        function translate() {
            $.ajax({
                //提交数据的类型 POST GET
                type: "POST",
                //提交的网址
                url: "Translate.ashx",
                //提交的数据
                data: $("#content").val(),
                //返回数据的格式
                datatype: "text",//"xml", "html", "script", "json", "jsonp", "text".
                //在请求之前调用的函数
                beforeSend: function () { $("#msg").html("logining"); },
                //成功返回之后调用的函数             
                success: function (data) {
                    $("#msg").html(decodeURI(data));
                }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>欢迎使用Misaya's Translater</h2>
    <br />
    <div>
        <div>
            <textarea rows="10" cols="100"
                id="content"
                name="content"
                onblur="if (this.value == '') {this.value = '请在此输入需要翻译的内容';}"
                onfocus="this.value = '';">

            </textarea>
        </div>
        <div>
            <input value="点击此处翻译" type="button" onclick="javascript:translate()" />
        </div>
        <div id="msg" class="msg">
        </div>
    </div>

</asp:Content>
